package com.esri.android.map.popup;

import android.graphics.Color;
import android.graphics.Typeface;
import android.view.View;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;

/* loaded from: classes.dex */
public class ArcGISPopupStyle implements PopupStyle {
    private static final String[] b = {"#FFB9D6F7", "#FF284B70", "#FFFBB7B5", "#FF702828", "#FFB8C0AC", "#FF5F7143", "#FFFDE79C", "#FFF6BC0C", "#FFA9A3BD", "#FF382C6C", "#FFB1A1B1", "#FF50224F", "#FF9DC2B3", "#FF1D7554", "#FFB5B5B5", "#FF4C4C4C", "#FF98C1DC", "#FF0271AE", "#FFC1C0AE", "#FF706E41", "#FFADBDC0", "#FF446A73", "#FF2F8CE2", "#FF0C3E69", "#FFDCDCDC", "#FF757575", "#FFF4F4F4", "#FFB7B7B7", "#FFF4F4F4", "#FFA3A3A3"};
    private ArrayList<IPopupStylable> a = new ArrayList<>();
    private int c = -1;
    private int d = 16;
    private Typeface e = Typeface.SANS_SERIF;
    private int f = 1;
    private int g = -16777216;
    private int h = 14;
    private Typeface i = Typeface.SANS_SERIF;
    private int j = 1;
    private int k = Color.parseColor("#FF0099CC");
    private boolean l = true;
    private int m = Color.parseColor("#FF0099CC");
    private int n = 2;
    private View o = null;
    private int p = 14;
    private Typeface q = Typeface.SANS_SERIF;
    private int r = 0;
    private int s = -16777216;
    private int t = -16777216;
    private int u = 14;
    private Typeface v = Typeface.SANS_SERIF;
    private int w = 0;
    private int x = -16777216;
    private int y = 14;
    private Typeface z = Typeface.SANS_SERIF;
    private int A = 2;
    private int B = -16777216;
    private int C = 14;
    private Typeface D = Typeface.SANS_SERIF;
    private int E = 1;
    private int F = -16777216;
    private int G = 14;
    private Typeface H = Typeface.SANS_SERIF;
    private int I = 0;
    private int J = -16777216;
    private String[] K = b;
    private int[] L = null;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public interface IPopupStylable {
        void applyStyle(ArcGISPopupStyle arcGISPopupStyle, STYLE_ELEMENT style_element);

        Set<STYLE_ELEMENT> getRegisteredStyle();
    }

    /* loaded from: classes.dex */
    public enum STYLE_ELEMENT {
        POPUP_BACKGROUND,
        POPUP_TITLE,
        FIELD_LABEL,
        SEPARATOR,
        EDIT_FIELD,
        FIELD_VALUE,
        MEDIA_CAPTION,
        MEDIA_VALUES,
        MEDIA_FULLSCREEN_CAPTION,
        MEDIA_FULLSCREEN_TITLE,
        MEDIA_FULLSCREEN_VALUES
    }

    public void registerStylable(IPopupStylable iPopupStylable) {
        this.a.add(iPopupStylable);
    }

    public void unregisterStylable(IPopupStylable iPopupStylable) {
        if (this.a.contains(iPopupStylable)) {
            this.a.remove(iPopupStylable);
        }
    }

    private void a(STYLE_ELEMENT style_element) {
        Iterator<IPopupStylable> it = this.a.iterator();
        while (it.hasNext()) {
            IPopupStylable next = it.next();
            if (next.getRegisteredStyle().contains(style_element)) {
                next.applyStyle(this, style_element);
            }
        }
    }

    @Override // com.esri.android.map.popup.PopupStyle
    public int getPopupBackgroundColor() {
        return this.c;
    }

    @Override // com.esri.android.map.popup.PopupStyle
    public void setPopupBackgroundColor(int i) {
        this.c = i;
        a(STYLE_ELEMENT.POPUP_BACKGROUND);
    }

    public int getPopupTitleFontSize() {
        return this.d;
    }

    public void setPopupTitleFontSize(int i) {
        this.d = i;
        a(STYLE_ELEMENT.POPUP_TITLE);
    }

    public Typeface getPopupTitleFontType() {
        return this.e;
    }

    public int getPopupTitleFontStyle() {
        return this.f;
    }

    public void setPopupTitleFontType(Typeface typeface) {
        this.e = typeface;
        a(STYLE_ELEMENT.POPUP_TITLE);
    }

    public void setPopupTitleFontTypeAndStyle(Typeface typeface, int i) {
        this.e = typeface;
        this.f = i;
        a(STYLE_ELEMENT.POPUP_TITLE);
    }

    public int getPopupTitleColor() {
        return this.g;
    }

    public void setPopupTitleColor(int i) {
        this.g = i;
        a(STYLE_ELEMENT.POPUP_TITLE);
    }

    public int getFieldLabelFontSize() {
        return this.h;
    }

    public void setFieldLabelFontSize(int i) {
        this.h = i;
        a(STYLE_ELEMENT.FIELD_LABEL);
    }

    public Typeface getFieldLabelFontType() {
        return this.i;
    }

    public int getFieldLabelFontStyle() {
        return this.j;
    }

    public void setFieldLabelFontType(Typeface typeface) {
        this.i = typeface;
        a(STYLE_ELEMENT.FIELD_LABEL);
    }

    public void setFieldLabelFontTypeAndStyle(Typeface typeface, int i) {
        this.i = typeface;
        this.j = i;
        a(STYLE_ELEMENT.FIELD_LABEL);
    }

    public int getFieldLabelColor() {
        return this.k;
    }

    public void setFieldLabelColor(int i) {
        this.k = i;
        a(STYLE_ELEMENT.FIELD_LABEL);
    }

    public boolean isShowFieldSeparator() {
        return this.l;
    }

    public void setShowFieldSeparator(boolean z) {
        this.l = z;
        a(STYLE_ELEMENT.SEPARATOR);
    }

    public int getFieldSeparatorColor() {
        return this.m;
    }

    public void setFieldSeparatorColor(int i) {
        this.m = i;
        a(STYLE_ELEMENT.SEPARATOR);
    }

    public int getFieldSeparatorWidth() {
        return this.n;
    }

    public void setFieldSeparatorWidth(int i) {
        this.n = i;
        a(STYLE_ELEMENT.SEPARATOR);
    }

    public View getCustomFieldSeparator() {
        return this.o;
    }

    public void setCustomFieldSeparator(View view) {
        this.o = view;
        a(STYLE_ELEMENT.FIELD_VALUE);
    }

    public int getFieldValueFontSize() {
        return this.p;
    }

    public void setFieldValueFontSize(int i) {
        this.p = i;
        a(STYLE_ELEMENT.FIELD_VALUE);
    }

    public Typeface getFieldValueFontType() {
        return this.q;
    }

    public void setFieldValueFontType(Typeface typeface) {
        this.q = typeface;
        a(STYLE_ELEMENT.FIELD_VALUE);
    }

    public void setFieldValueFontTypeAndStyle(Typeface typeface, int i) {
        this.q = typeface;
        this.r = i;
        a(STYLE_ELEMENT.FIELD_VALUE);
    }

    public int getFieldValueFontStyle() {
        return this.r;
    }

    public void setFieldValueFontStyle(int i) {
        this.r = i;
        a(STYLE_ELEMENT.FIELD_VALUE);
    }

    public int getFieldValueColor() {
        return this.s;
    }

    public void setFieldValueColor(int i) {
        this.s = i;
        a(STYLE_ELEMENT.FIELD_VALUE);
    }

    public int getEditFieldColor() {
        return this.t;
    }

    public void setEditFieldColor(int i) {
        this.t = i;
        a(STYLE_ELEMENT.EDIT_FIELD);
    }

    public int getMediaCaptionFontSize() {
        return this.u;
    }

    public void setMediaCaptionFontSize(int i) {
        this.u = i;
        a(STYLE_ELEMENT.MEDIA_CAPTION);
    }

    public Typeface getMediaCaptionFontType() {
        return this.v;
    }

    public void setMediaCaptionFontType(Typeface typeface) {
        this.v = typeface;
        a(STYLE_ELEMENT.MEDIA_CAPTION);
    }

    public void setMediaCaptionFontTypeAndStyle(Typeface typeface, int i) {
        this.v = typeface;
        this.w = i;
        a(STYLE_ELEMENT.MEDIA_CAPTION);
    }

    public int getMediaCaptionFontStyle() {
        return this.w;
    }

    public void setMediaCaptionFontStyle(int i) {
        this.w = i;
        a(STYLE_ELEMENT.MEDIA_CAPTION);
    }

    public int getMediaCaptionColor() {
        return this.x;
    }

    public void setMediaCaptionColor(int i) {
        this.x = i;
        a(STYLE_ELEMENT.MEDIA_CAPTION);
    }

    public int getMediaFullScreenCaptionFontSize() {
        return this.y;
    }

    public void setMediaFullScreenCaptionFontSize(int i) {
        this.y = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_CAPTION);
    }

    public Typeface getMediaFullScreenCaptionFontType() {
        return this.z;
    }

    public void setMediaFullScreenCaptionFontType(Typeface typeface) {
        this.z = typeface;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_CAPTION);
    }

    public void setMediaFullScreenCaptionFontTypeAndStyle(Typeface typeface, int i) {
        this.z = typeface;
        this.A = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_CAPTION);
    }

    public int getMediaFullScreenCaptionFontStyle() {
        return this.A;
    }

    public void setMediaFullScreenCaptionFontStyle(int i) {
        this.A = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_CAPTION);
    }

    public int getMediaFullScreenCaptionColor() {
        return this.B;
    }

    public void setMediaFullScreenCaptionColor(int i) {
        this.B = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_CAPTION);
    }

    public int getMediaFullScreenTitleFontSize() {
        return this.C;
    }

    public void setMediaFullScreenTitleFontSize(int i) {
        this.C = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_TITLE);
    }

    public Typeface getMediaFullScreenTitleFontType() {
        return this.D;
    }

    public void setMediaFullScreenTitleFontType(Typeface typeface) {
        this.D = typeface;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_TITLE);
    }

    public void setMediaFullScreenTitleFontTypeAndStyle(Typeface typeface, int i) {
        this.D = typeface;
        this.E = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_TITLE);
    }

    public int getMediaFullScreenTitleFontStyle() {
        return this.E;
    }

    public void setMediaFullScreenTitleFontStyle(int i) {
        this.E = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_TITLE);
    }

    public int getMediaFullScreenTitleColor() {
        return this.F;
    }

    public void setMediaFullScreenTitleColor(int i) {
        this.F = i;
        a(STYLE_ELEMENT.MEDIA_FULLSCREEN_TITLE);
    }

    public int getMediaChartValuesFontSize() {
        return this.G;
    }

    public void setMediaChartValuesFontSize(int i) {
        this.G = i;
        a(STYLE_ELEMENT.MEDIA_VALUES);
    }

    public Typeface getMediaChartValuesFontType() {
        return this.H;
    }

    public void setMediaChartValuesFontType(Typeface typeface) {
        this.H = typeface;
        a(STYLE_ELEMENT.MEDIA_VALUES);
    }

    public void setMediaChartValuesFontTypeAndStyle(Typeface typeface, int i) {
        this.H = typeface;
        this.I = i;
        a(STYLE_ELEMENT.MEDIA_VALUES);
    }

    public int getMediaChartValuesFontStyle() {
        return this.I;
    }

    public void setMediaChartValuesFontStyle(int i) {
        this.I = i;
        a(STYLE_ELEMENT.MEDIA_VALUES);
    }

    public int getMediaChartValuesColor() {
        return this.J;
    }

    public void setMediaChartValuesColor(int i) {
        this.J = i;
        a(STYLE_ELEMENT.MEDIA_VALUES);
    }

    public String[] getPieChartColors() {
        return this.K;
    }

    public void setPieChartColors(String[] strArr) {
        this.K = strArr;
        a(STYLE_ELEMENT.MEDIA_VALUES);
    }

    public int[] getChartColors() {
        return this.L;
    }

    public void setChartColors(int[] iArr) {
        this.L = iArr;
        a(STYLE_ELEMENT.MEDIA_VALUES);
    }

    public int[] getColorRamp(int i) {
        String[] strArr = b;
        if (i >= strArr.length / 2) {
            i %= strArr.length / 2;
        }
        int[] iArr = new int[2];
        int[] iArr2 = this.L;
        if (iArr2 == null || i >= iArr2.length / 2) {
            int i2 = i * 2;
            iArr[0] = Color.parseColor(strArr[i2]);
            iArr[1] = Color.parseColor(strArr[i2 + 1]);
        } else {
            int i3 = i * 2;
            iArr[0] = iArr2[i3];
            iArr[1] = iArr2[i3 + 1];
        }
        return iArr;
    }
}
